# task_scheduler.py
from mcp_service import EnhancedPyMasterControl

class TaskScheduler:
    def __init__(self):
        self.mcp = EnhancedPyMasterControl("mcp_config.yaml")
        
    def run(self):
        # 启动服务
        self.mcp.start_service()
        
        # 执行预定义命令
        try:
            task_id = self.mcp.execute_command(
                "start_task",
                task_id="TASK_001",
                params={"priority": "high"}
            )
            
            metrics = self.mcp.execute_command("get_stats")
            print(f"Current metrics: {metrics}")
            
        except Exception as e:
            print(f"Command failed: {str(e)}")
